package com.openharmony.filepicker.filetype;


import com.openharmony.filepicker.ResourceTable;

public class RasterImageFileType extends FileType{

    public RasterImageFileType() {
        this.setFileType("Image");
        this.setFileIconResId(ResourceTable.Media_ic_image_file_picker);
    }

    @Override
    public boolean verify(String fileName) {
        boolean isHasSuffix = fileName.contains(".");
        if (!isHasSuffix) {
            return false;
        }
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);

        switch (suffix) {
            case "jpeg":
            case "jpg":
            case "bmp":
            case "dds":
            case "gif":
            case "png":
            case "psd":
            case "pspimage":
            case "tga":
            case "thm":
            case "tif":
            case "tiff":
            case "yuv":
                return true;
            default:
                return false;
        }
    }
}
